import {
  ActionButtonsSettings,
  BaseFormSettings,
  ActionButtons as BitActionButtons,
  BaseForm as BitBaseForm,
  Card as BitCard,
  ComponentContainer as BitComponentContainer,
  CustomModal as BitCustomModal,
  FilterForm as BitFilterForm,
  Form as BitForm,
  FormContainer as BitFormContainer,
  Layout as BitLayout,
  TabRadio as BitTabRadio,
  Table as BitTable,
  Tabs as BitTabs,
  CardSettings,
  ComponentContainerSettings,
  CustomModalSettings,
  FilterFormSettings,
  FormContainerSettings,
  FormDefaultProps,
  FormSettings,
  LayoutSettings,
  TabRadioSettings,
  TableSettings,
  TabsSettings,
  baseFormDefaultProps,
  cardDefaultProps,
  componentContainerDefaultProps,
  componentContainerHoc,
  customModalDefaultProps,
  defaultActionButtonsProps,
  filterFormDefaultProps,
  formContainerDefaultProps,
  layoutDefaultProps,
  tabRadioDefaultProps,
  tableDefaultProps,
  tabsDefaultProps,
} from '@jeoshi-pro/pro-rex.low-code.core';
import { warpComponentFn } from './utils/warpComponentFn';

export const ComponentContainer = warpComponentFn(
  'ComponentContainer',
  BitComponentContainer,
  ComponentContainerSettings,
  componentContainerDefaultProps,
  {
    isContainer: true,
    name: '容器',
    sort: 1,
  },
);
export const FormContainer = warpComponentFn(
  'FormContainer',
  componentContainerHoc(BitFormContainer),
  FormContainerSettings,
  formContainerDefaultProps,
  {
    isContainer: true,
    name: '表单容器',
    sort: 2,
  },
);
export const Layout = warpComponentFn(
  'Layout',
  BitLayout,
  LayoutSettings,
  layoutDefaultProps,
  {
    isContainer: true,
    name: '布局容器',
    sort: 3,
  },
);
export const Card = warpComponentFn(
  'Card',
  BitCard,
  CardSettings,
  cardDefaultProps,
  {
    isContainer: true,
    name: '卡片容器',
    sort: 4,
  },
);
export const FilterForm = warpComponentFn(
  'FilterForm',
  componentContainerHoc(BitFilterForm),
  FilterFormSettings,
  filterFormDefaultProps,
  {
    name: '搜索表单',
  },
);
export const Tabs = warpComponentFn(
  'Tabs',
  BitTabs,
  TabsSettings,
  tabsDefaultProps,
  {
    name: '选项卡',
  },
);

export const BaseForm = warpComponentFn(
  'BaseForm',
  componentContainerHoc(BitBaseForm),
  BaseFormSettings,
  baseFormDefaultProps,
  {
    name: '表单项',
  },
);

export const Form = warpComponentFn(
  'Form',
  BitForm,
  FormSettings,
  FormDefaultProps,
  {
    name: '表单',
  },
);

export const ActionButtons = warpComponentFn(
  'ActionButtons',
  componentContainerHoc(BitActionButtons),
  ActionButtonsSettings,
  defaultActionButtonsProps,
  {
    name: '按钮组',
    style: {
      display: 'inherit',
      gap: 'inherit',
      flexWrap: 'inherit',
      alignItems: 'inherit',
      justifyContent: 'inherit',
    },
  },
);

export const Table = warpComponentFn(
  'Table',
  componentContainerHoc(BitTable),
  TableSettings,
  tableDefaultProps,
  {
    name: '表格',
  },
);

export const TabRadio = warpComponentFn(
  'TabRadio',
  componentContainerHoc(BitTabRadio),
  TabRadioSettings,
  tabRadioDefaultProps,
  {
    name: 'Tab单选',
  },
);

export const CustomModal = warpComponentFn(
  'CustomModal',
  BitCustomModal,
  CustomModalSettings,
  customModalDefaultProps,
  {
    hidden: true,
  },
);
